package com.itheima.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Demo2 {
    public static void main(String[] args) {
        ArrayList<String> team1 = new ArrayList<>();
        team1.add("陈玄风");
        team1.add("梅超风");
        team1.add("风清扬");
        team1.add("解风");
        team1.add("风波恶");
        team1.add("陆乘风");
        team1.add("曲灵风");
        team1.add("武眠风");
        team1.add("冯默风");
        team1.add("陆小风");

        ArrayList<String> team2 = new ArrayList<>();
        team2.add("宋远桥");
        team2.add("俞莲舟");
        team2.add("俞岱岩");
        team2.add("张松溪");
        team2.add("张翠山");
        team2.add("殷梨亭");
        team2.add("莫声谷");

        Stream<String> s1 = team1.stream()
                .filter(s -> s.endsWith("风")&& s.length() == 3).limit(6);
       // s1.forEach(s -> System.out.println(s));

        System.out.println("-------------------------");

        Stream<String> s2 = team2.stream().filter(s -> s.startsWith("张")).skip(1);
      // s2.forEach(s -> System.out.println(s));

        Stream<String> concat = Stream.concat(s1, s2);

        List<Student> list = concat.map(Student::new)
                .collect(Collectors.toList());

        list.forEach(System.out::println);

    }
}
